import React, { Component } from "react";
import Rfc from "./Rfc";
import Rcc from "./Rcc";

export default class App extends Component {
  state = {
    num: 0,
  };
  render() {
    return (
      <div>
        <h1>App---{this.state.num}</h1>
        <Rfc getChildData={this.getChildData}></Rfc>
        <Rcc click={(num) => this.getChildData(num)}></Rcc>
      </div>
    );
  }

  getChildData(id) {
    // console.log(id);
    // this.state.num = id;
    this.setState({
      num: id,
    });
  }
}
